<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1252">
<META NAME="Generator" CONTENT="Microsoft Word 97">
<TITLE>CD ROM</TITLE>
<META NAME="Template" CONTENT="C:\PROGRAM FILES\MICROSOFT OFFICE\OFFICE\html.dot">
</HEAD>
<BODY TEXT="#000000" LINK="#0000ff" VLINK="#800080" BGCOLOR="#ffffff" leftmargin="8">
<FONT FACE="Verdana"><H2><A NAME="MYSAMPLE">CD ROM</A> </H2>

<H3>SUMMARY</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
The CD ROM driver is used to provide access to CD, DVD and Blu-ray drives. It supports Plug and Play, Power Management, and AutoRun (media change notification). It is a 64-bit compliant driver.

<H3>BUILDING THE SAMPLE</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
To build cdrom.sys, you must first set up the DDK/WDK environment on your host machine. The "Installation and Release Notes" in the Windows 2000/XP/Server 2003/Vista/Server 2008/Windows 7 DDK/WDK has a complete description on how to do this.
<UL>
    <LI>Click the <B>Free Build Environment</B> or <B>Checked Build Environment</B> icon under your Windows Driver Kit program group to set basic environment variables need by the build utility.</LI>
    <LI>Change to the directory containing the driver source code, such as "cd src\storage\class\cdrom".</LI>
    <LI>Build the driver by typing <B>BLD</B>.</LI>
</UL>

Macro <B>BLD</B> invokes the Microsoft make routines that produce log file called buildxxx_yyy_zzz.log, and also buildxxx_yyy_zzz.wrn and buildxxx_yyy_zzz.err if there are any warnings or errors, where xxx stands for <B>fre</B> or <B>chk</B> depending on the environment chosen, yyy stands for the OS version (W2k, WXP, Wnet or Win7), and zzz stands for platform version (x86, ia64 or amd64).

<P>If the build succeeds, the driver will be placed in the binary output directory specified for the build environment. You can get the output path from the buildxxx_yyy_zzz.log file.

<H3>INSTALLATION</H3></FONT><FONT FACE="Verdana" SIZE=2><P>
The in-box CD ROM driver is protected by the system, and thus a normal device driver update attempt through the Device Manager will fail. Users are not encouraged to replace the in-box CD ROM driver. The following work-around is provided in case there is a need, but the users are warned that this may harm the system.
<UL>
    <LI>Click the <B>Free Build Environment</B> or <B>Checked Build Environment</B> icon under your Windows Driver Kit program group to set basic environment variables need by the build utility.</LI>
    <LI>Change to the directory containing the driver source code, such as "cd src\storage\class\cdrom".</LI>
    <LI>Update the "sources" file by changing the "TARGETNAME" from "cdrom" to "mycdrom".</LI>
    <LI>Build the driver by typing <B>BLD</B>.</LI>
    <LI>Locate the "cdrom.inf" file in the binary output directory, and update the file by replacing all "cdrom.sys" occurrences with "mycdrom.sys".</LI>
    <LI>Rename the "cdrom.inf" file to "mycdrom.inf".</LI>
    <LI>Copy "mycdrom.sys" and "mycdrom.inf" from the binary output directory to the test machine, if applicable.</LI>
    <LI>Launch the Device Manager (by clicking on Windows Start, Run option and typing "devmgmt.msc").</LI>
    <LI>Select the appropriate device under the "DVD/CD-ROM drives" category.</LI>
    <LI>On the right-click menu, select "Update Driver Software...".</LI>
    <LI>Select "Browse my computer for driver software".</LI>
    <LI>Select "Let me pick from a list of device drivers on my computer".</LI>
    <LI>Click "Have Disk...", and point to the directory that contains "mycdrom.inf" and "mycdrom.sys".</LI>
    <LI>Click "Next". If you get a warning dialog about installing unsigned driver, click "Yes".</LI>
    <LI>Click "Next" to complete the driver upgrade.</LI>
</UL>

<B>NOTE:</B> After installation completes successfully, "mycdrom.sys" will be the effective driver for the device, "cdrom.sys" will no longer be used.

<H3>CODE TOUR</H3>
<H4>File Manifest</H4>
</FONT><U><PRE>File&#9;&#9;	Description
</U>

aacs.c&#9;&#9;	The CDROM class driver implementation of handling AACS IOCTLs
autorun.c&#9;	Code for supporting media change detection in the cd/dvd driver
cdrom.c&#9;&#9;	Main code base
cdrom.h&#9;&#9;	Main header file for cdrom.sys
cdrom.htm&#9;	This file
cdrom.inf&#9;	The CDROM class driver configuration file
cdrom.rc&#9;	Resource file
cdromp.h&#9;	Private header file for cdrom.sys modules
common.c&#9;	Shared private routines for cdrom.sys
data.c&#9;&#9;	Global data definitions
guid.c&#9;&#9;	GUIDs needed for cdrom.sys
init.c&#9;&#9;	Initialization routines for cdrom.sys
ioctl.c&#9;&#9;	Ioctl dispatch handlers
ioctl.h&#9;&#9;	Ioctl dispatch handlers - header file
makefile&#9;	Makefile
makefile.inc&#9;	Makefile used to generate custom targets required by the module
mmc.c&#9;&#9;	All functions related to MMC
mmc.h&#9;&#9;	All functions related to MMC - header file
pnppower.c&#9;	Functions to handle PnP and Power IRPs
scratch.c&#9;	Functions for using common scratch buffer
scratch.h&#9;	Functions for using common scratch buffer - header file
sense.c&#9;&#9;	Functions needed to accurately determine how to retry requests on CDROM device types
sources&#9;&#9;	Macro definitions that are recognized by the Build utility


</FONT><P ALIGN="CENTER"><A HREF="#top"><FONT FACE="Verdana" SIZE=2>Top of page</FONT></A><FONT FACE="Verdana" SIZE=2> </P></FONT>
<TABLE CELLSPACING=0 BORDER=0 WIDTH=624>
<TR><TD VALIGN="MIDDLE" BGCOLOR="#00ffff" HEIGHT=2>
<P></TD>
</TR>
</TABLE>

<FONT FACE="MS Sans Serif" SIZE=1><P>&copy; 2008 Microsoft Corporation</FONT><FONT FACE="Verdana" SIZE=2> </P></FONT></BODY>
</HTML>

